angular.module('YhyApp').controller('searchController', function($rootScope, $scope, $http, $timeout,$filter) {
	$scope.$on('$viewContentLoaded', function() {
		$scope.back = function() {
			history.back();
		};
		$scope.modal = {
		  	currentValue:''
		};
		$scope.search = function() {//执行搜索
			let val = $scope.modal.currentValue;
//			console.log(val);
//			if (!val) {
//				alert('内容不能为空');
//		      	return;
//		   	};
//			$http.get("接口")
//			.then(function (response) {
//				$scope.pList=$filter("filter")(response.data,val); 
//			});

			$http({
                method: "post",
               	data:{val:val},
//             	url:"接口",  
				url:"http://localhost/api/angular-system/search.php",
               	headers:{'Content-Type': 'application/x-www-form-urlencoded'},
                transformRequest: function(obj) {  
				    var str = [];  
				    for(var p in obj){  
				       str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));  
				    }  
				    return str.join("&");  
				}   
            }).success(function(){
                console.log(val)
            });
			
		}
	});
});